package com.mgq.design.bridge;

import java.util.Random;

/**
 * <b>功能：</b>修正抽象化(RefinedAbstraction)角色<br>
 * <b>Copyright mgq</b>
 * <li>版本&nbsp;&nbsp;&nbsp;&nbsp;修改日期&nbsp;&nbsp;&nbsp;&nbsp;部　　门&nbsp;&nbsp;&nbsp;&nbsp;作　者&nbsp;&nbsp;&nbsp;&nbsp;变更内容</li><hr>
 * <li>v1.0&nbsp;&nbsp;&nbsp;&nbsp;20220316&nbsp;&nbsp;营业后台&nbsp;&nbsp;&nbsp;&nbsp;马广奇&nbsp;&nbsp;&nbsp;&nbsp;创建类</li>
 * <br><br>
 *
 * @author 马广奇
 * @version 2022-03-16 13:43
 */
public abstract class RefinedCoffee extends Coffee {
    /**
     * <b>功能描述：</b>构造方法,传入口味实现类<br>
     * <b>修订记录：</b><br>
     * <li>20220316&nbsp;&nbsp;|&nbsp;&nbsp;马广奇&nbsp;&nbsp;|&nbsp;&nbsp;创建方法</li><br><br>
     *
     * @param additives 口味实现类
     */
    public RefinedCoffee(CoffeeAdditives additives) {
        super(additives);
    }

    /**
     * <b>功能描述：</b>检查品质的方法(增强父类)<br>
     * <b>修订记录：</b><br>
     * <li>20220316&nbsp;&nbsp;|&nbsp;&nbsp;马广奇&nbsp;&nbsp;|&nbsp;&nbsp;创建方法</li><br><br>
     *
     * @param
     * @return void
     */
    public void checkQuality() {
        Random random = new Random();
        System.out.println(String.format("%s 口味%s", additives.getClass().getSimpleName(),
                random.nextBoolean() ? "太多" : "正常"));
    }
}
